package com.fitz.proxy;

import com.fitz.cluster.AbstractClusterStrategy;
import com.fitz.loadbalance.AbstractLoadBalance;
import com.fitz.registry.InstanceInfo;
import com.fitz.registry.InstanceRegistry;

/**
 * @author fitz 2020-5-20 17:14
 */

public class RpcReferenceBean {

    private String interfaceName;

    private int retry = 2;

    private Class<? extends AbstractLoadBalance> loadBalance;

    private long timeout;

//    private String address;

    private InstanceInfo instance;

    private AbstractClusterStrategy clusterStrategy;

    private InstanceRegistry instanceRegistry;

    //连接池初始化参数
    private ConnectPoolParam connectPoolParam;

    public RpcReferenceBean() {
    }

    public RpcReferenceBean(int retry, Class<? extends AbstractLoadBalance> loadBalance) {
        this.retry = retry;
        this.loadBalance = loadBalance;
    }

    public String getInterfaceName() {
        return interfaceName;
    }

    public void setInterfaceName(String interfaceName) {
        this.interfaceName = interfaceName;
    }

    public int getRetry() {
        return retry;
    }

    public void setRetry(int retry) {
        this.retry = retry;
    }

    public Class<? extends AbstractLoadBalance> getLoadBalance() {
        return loadBalance;
    }

    public void setLoadBalance(Class<? extends AbstractLoadBalance> loadBalance) {
        this.loadBalance = loadBalance;
    }

    public long getTimeout() {
        return timeout;
    }

    public void setTimeout(long timeout) {
        this.timeout = timeout;
    }
//
//    public String getAddress() {
//        return address;
//    }
//
//    public void setAddress(String address) {
//        this.address = address;
//    }


    public InstanceInfo getInstance() {
        return instance;
    }

    public void setInstance(InstanceInfo instance) {
        this.instance = instance;
    }

    public AbstractClusterStrategy getClusterStrategy() {
        return clusterStrategy;
    }

    public void setClusterStrategy(AbstractClusterStrategy clusterStrategy) {
        this.clusterStrategy = clusterStrategy;
    }

    public InstanceRegistry getInstanceRegistry() {
        return instanceRegistry;
    }

    public void setInstanceRegistry(InstanceRegistry instanceRegistry) {
        this.instanceRegistry = instanceRegistry;
    }

    public ConnectPoolParam getConnectPoolParam() {
        return connectPoolParam;
    }

    public void setConnectPoolParam(ConnectPoolParam connectPoolParam) {
        this.connectPoolParam = connectPoolParam;
    }
}
